package com.qd.panda.mapper.wallet.user;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qd.common.flow.domain.approval.FlowDataDTO;
import com.qd.common.panda.domain.entity.wallet.user.UserWalletRefundApplyDTO;
import com.qd.common.panda.domain.entity.wallet.user.UserWalletRefundApplyStatisticsDTO;
import com.qd.panda.model.UserWalletRefundApply;
import org.apache.ibatis.annotations.Param;

/**
 * 用户退款申请
 *
 * @author sjk
 */
public interface UserWalletRefundApplyMapper extends BaseMapper<UserWalletRefundApply> {
    /**
     * 分页
     *
     * @param page  分页属性
     * @param query 查询条件
     * @return 数据
     */
    IPage<UserWalletRefundApplyDTO> page(IPage<UserWalletRefundApply> page, @Param(Constants.WRAPPER) Wrapper<UserWalletRefundApply> query);

    /**
     * 已办分页
     * @param page 分页属性
     * @param query 查询条件
     * @return 数据
     */
    IPage<FlowDataDTO<UserWalletRefundApplyDTO>> refundApprovedPage(IPage<UserWalletRefundApply> page, @Param(Constants.WRAPPER) Wrapper<UserWalletRefundApply> query);

    /**
     * 审批分页
     * @param page 分页属性
     * @param query 查询条件
     * @return 数据
     */
    IPage<FlowDataDTO<UserWalletRefundApplyDTO>> flowPage(Page<FlowDataDTO<UserWalletRefundApplyDTO>> page, @Param(Constants.WRAPPER)QueryWrapper<UserWalletRefundApply> query);

    UserWalletRefundApplyStatisticsDTO sumAmount(@Param(Constants.WRAPPER)QueryWrapper<UserWalletRefundApply> query);
}